﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Homework
{
    class Program
    {
        static void Main(string[] args)
        {
            //隐式实现接口
            IPerform1 jf1 = new Garfield();
            jf1.Perform();

            Garfield jf2 = new Garfield();
            jf2.Perform();
            Console.ReadKey();

            //显式实现接口
            IPerform1 pig1 =new PeppaPig();
            pig1.Perform();

            IPerform2 pig2 = new PeppaPig();
            pig2.Perform();

            //PeppaPig pig3 = new PeppaPig();
            //pig3.Perform();
            Console.ReadKey();

            //共同实现
            IPerform1 tom1 = new Tom();
            tom1.Perform();

            Tom tom2 = new Tom();
            tom2.Perform();
            Console.ReadKey();

            //多态下的接口
            IPerform1[] performs =
            {
                new Tom(),
                new Garfield(),
                new PeppaPig()
            };
            foreach (IPerform1 perform in performs)
            {
                perform.Perform();
            }
        }
    }
}
